package com.service.impl;

import com.dao.ShopDao;
import com.dao.impl.ShopDaoImpl;
import com.entity.Foods;
import com.service.ShopService;

import java.util.List;
import java.util.Map;

public class ShopServiceImpl implements ShopService {
    ShopDao shopDao=new ShopDaoImpl();
    @Override
    public List<Foods> findShop(int typeId) {
        List<Foods> shop = shopDao.findShop(typeId);
        if (shop!=null){
            return shop;
        }
        return null;
    }
    /**
     * 查询所有食物
     * @return
     */
    @Override
    public List<Map<String, Object>> foodFindAll() {
        List<Map<String, Object>> foods= shopDao.foodFindAll();
        if (foods!=null){
            return foods;
        }
        return null;
    }

    @Override
    public List<Map<String, Object>> shopFind(int pageNum, int startCount) {
        List<Map<String, Object>> foods= shopDao.shopFind(pageNum,startCount);
        if (foods!=null){
            return foods;
        }
        return null;
    }

    @Override
    public List<Map<String, Object>> listPrice(int pageNum,int startCount) {
        List<Map<String, Object>> foods= shopDao.listPrice(pageNum,startCount);
        if (foods!=null){
            return foods;
        }
        return null;
    }

    @Override
    public List<Map<String, Object>> listPriceDesc(int pageNum,int startCount) {
        List<Map<String, Object>> foods= shopDao.listPriceDesc(pageNum,startCount);
        if (foods!=null){
            return foods;
        }
        return null;
    }

    @Override
    public List<Map<String, Object>> lisLikeDesc(int pageNum,int startCount) {
        List<Map<String, Object>> foods= shopDao.lisLikeDesc(pageNum,startCount);
        if (foods!=null){
            return foods;
        }
        return null;
    }

    @Override
    public List<Map<String, Object>> findPrice(int max, int min,int pageNum,int startCount) {
        List<Map<String, Object>> foods= shopDao.findPrice(max,min,pageNum,startCount);
        if (foods!=null){
            return foods;
        }
        return null;
    }

    @Override
    public List<Map<String, Object>> findName(String name) {
        List<Map<String, Object>> foods= shopDao.findName(name);
        if (foods!=null){
            return foods;
        }
        return null;
    }

    @Override
    public List<Map<String, Object>> lisLikeFour() {
        List<Map<String, Object>> foods= shopDao.lisLikeFour();
        if (foods!=null){
            return foods;
        }
        return null;
    }

    @Override
    public int getCount() {
        int foods= shopDao.getCount();
        if (foods!=0){
            return foods;
        }
        return 0;
    }

    @Override
    public int getPriceCount(int max, int min) {
        int foods= shopDao.getPriceCount(max,min);
        if (foods!=0){
            return foods;
        }
        return 0;
    }


}
